CXX = g++
CXXFLAGS = -I$(INCLUDE_PATH)

INCLUDE_PATH = include
SRC_PATH = src
BIN_PATH = bin
IMAGE_PATH = image

INCLUDES = $(INCLUDE_PATH)/bezier_curve.hpp $(INCLUDE_PATH)/newton_interpolation.hpp $(INCLUDE_PATH)/hermite_interpolation.hpp

report: report.tex
	xelatex report.tex

#run: B C D E F
#	@echo "-------- RUNNING PROGRAM B --------"
#	./$(BIN_PATH)/B
#	@echo "-------- PROGRAM B IS COMPLETE --------\n"
#	@echo "-------- RUNNING PROGRAM C --------"
#	./$(BIN_PATH)/C
#	@echo "-------- PROGRAM C IS COMPLETE --------\n"
#	@echo "-------- RUNNING PROGRAM D --------"
#	./$(BIN_PATH)/D
#	@echo "-------- PROGRAM D IS COMPLETE --------\n"
#	@echo "-------- RUNNING PROGRAM E --------"
#	./$(BIN_PATH)/E
#	@echo "-------- PROGRAM E IS COMPLETE --------\n"
#	@echo "-------- RUNNING PROGRAM F --------"
#	./$(BIN_PATH)/F
#	@echo "-------- PROGRAM F IS COMPLETE --------\n"

B: $(BIN_PATH)/B
C: $(BIN_PATH)/C
D: $(BIN_PATH)/D
E: $(BIN_PATH)/E
F: $(BIN_PATH)/F

$(BIN_PATH)/B: src/B.cpp $(INCLUDES)
	@echo "-------- RUNNING PROGRAM B --------"
	$(CXX) $(CXXFLAGS) -o $@ $<
	./bin/B
	gnuplot -persisit B.plt
	@echo "-------- PROGRAM B IS COMPLETE --------\n"
$(BIN_PATH)/C: src/C.cpp $(INCLUDES)
	@echo "-------- RUNNING PROGRAM C --------"
	$(CXX) $(CXXFLAGS) -o $@ $<
	./bin/C
	gnuplot -persisit C.plt
	@echo "-------- PROGRAM C IS COMPLETE --------\n"
$(BIN_PATH)/D: src/D.cpp $(INCLUDES)
	@echo "-------- RUNNING PROGRAM D --------"
	$(CXX) $(CXXFLAGS) -o $@ $<
	./bin/D
	@echo "-------- PROGRAM D IS COMPLETE --------\n"	
$(BIN_PATH)/E: src/E.cpp $(INCLUDES)
	@echo "-------- RUNNING PROGRAM E --------"
	$(CXX) $(CXXFLAGS) -o $@ $<
	./bin/E
	gnuplot -persist E.plt
	@echo "-------- PROGRAM E IS COMPLETE --------\n"	
$(BIN_PATH)/F: src/F.cpp $(INCLUDES)
	@echo "-------- RUNNING PROGRAM F --------"
	$(CXX) $(CXXFLAGS) -o $@ $<
	./bin/F
	gnuplot -persist F.plt 
	@echo "-------- PROGRAM F IS COMPLETE --------\n"
.PHONY: clean

clean:
	rm -f $(BIN_PATH)/* $(SRC_PATH)/*~ *.aux *.log *.pdf *.out *synctex.gz *.txt *~
